from django.contrib import admin
from .models import ParsedQuestion, ParserTask

@admin.register(ParsedQuestion)
class ParsedQuestionAdmin(admin.ModelAdmin):
    list_display = ('id', 'document', 'question_type', 'page_number', 'created_at')
    list_filter = ('question_type', 'document', 'page_number')
    search_fields = ('content', 'answer')

@admin.register(ParserTask)
class ParserTaskAdmin(admin.ModelAdmin):
    list_display = ('id', 'document', 'status', 'created_at', 'completed_at', 'questions_count')
    list_filter = ('status', 'created_at')
    search_fields = ('document__title', 'error_message')
